public class Test1 {
    public static double avg(int[] arr1){
        int sum = 0;
        for(int x:arr1){
            sum += x;
        }
        return (1.0*sum) / arr1.length;
    }
    public static void main(String[] args) {
        int[] arr = {1,2,2,4,5};
        double rec = avg(arr);
        System.out.println(rec);
    }
}
